<!--suppress ALL -->
<template>
  <div>
    <span style="float: right; padding-right: 2px; margin-right: 2px">
      <el-button :type="type" :icon="icon" round size="medium" @click="doFunc"></el-button>
    </span>
    <span>
    <list-cpt :head-items=this.headItems :data=this.data :paged=this.paged
              :content="content"
              @refreshPageSize="refreshPageSize" @refreshCurrentPage="refreshCurrentPage">

    </list-cpt>
  </span>
  </div>
</template>

<script>
  import ListCpt from '../../../components/ListCpt'
  import {filmFilmItem} from '../../../components/Po'
  import {url} from '../../../common/Common.js'
  import {get} from '../../../components/HttpUtil'
  export default {
    name: 'FilmFastPage',
    components: {ListCpt},
    data () {
      return {
        headItems: filmFilmItem,
        paged: true,
        currentPage: 1,
        pageSize: 10,
        count: 0,
        data: {},
        filmListUrl: url.film.film.list,

        content: {},
        type: 'primary',
        icon: 'el-icon-monitor',

      }
    },

    methods: {
      gainList: function () {
        var url = this.filmListUrl + '?size=' + this.pageSize + '&page=' + this.currentPage
        get(url, this.$store.state.token)
          .then(res => {
            this.data = res.data
          })
          .catch(e => {
            console.log(e)
          })
      },
      refreshPageSize (val) {
        this.currentPage = 1
        this.pageSize = val
        this.gainList()
      },

      refreshCurrentPage (val) {
        this.currentPage = val
        this.gainList()
      },

      doFunc () {
        this.$router.push('/FilmPicPage')
      }
    },

    created: function () {
      this.gainList()
    }

  }


</script>

